import request from '@/utils/request.js'
const userInfoAPI = () => {
  return request({
    url: '/v1_0/user'
  })
}
const userProfileAPI = () => {
  return request({
    url: '/v1_0/user/profile'
  })
}
// 更新用户头像
const updatePhotoAPI = (formObj) => {
  return request({
    url: '/v1_0/user/photo',
    method: 'PATCH',
    data: formObj
    // 如果你的请求体内容是表单对象, 浏览器会自动携带请求头Content-Type为multipart/form-data
  })
}
const updateProfileAPI = ({ birthday, userName }) => {
  return request({
    url: '/v1_0/user/profile',
    method: 'PATCH',
    data: {
      birthday: birthday,
      name: userName
    }
  })
}
export { userInfoAPI, userProfileAPI, updatePhotoAPI, updateProfileAPI }
